<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/style/global.css" />
<link rel="stylesheet" type="text/css" href="/style/admin.css" />
<link rel="stylesheet" type="text/css" href="/style/tip.css" />
<script src="/js/xheditor/jquery/jquery-1.4.4.min.js"></script>
<title>问卷管理__修改</title>
</head>
<body>
	<div id="wrap">
    	<div id="public_head"></div>
        <div class="m_search">
        <?php if(CSM_UNIT_ID>0){?>
        	<input class="btn_add" name="" type="button" value="" onclick="document.location.href='/index.php?c=qcat&a=add&p=<?php echo $page;?>&s=<?php echo $select;?>&t=<?php echo $mid;?>'" /> 
        <?php }?>	
        	分类名称<input class="qi_text" name="" type="text" id="cateName" value="<?php echo $select?>"/> 
        	<input class="btn_search" name="" type="button" />
        </div>
        <div class="m_content">
        	<table class="qi_table" width="0" border="0" cellpadding="0" cellspacing="1">
              <tr><th>分类名称</th><th>更新人</th><th>更新时间</th><th>操作</th></tr>
              <?php 
              	if(is_array($allCate) && count($allCate)>0){
              		foreach ($allCate as $v){?>
	<tr>
		<td style="text-align: left;"><?php echo str_replace($select, '<font style="color:red;font-weight:bold;">'.$select.'</font>&nbsp;', $v['CAT_NAME'])?></td>
		<td><?php echo $v['UPD_USER']?></td>
		<td><?php echo $v['UPD_TIME']?></td>
		<td><a href="/index.php?c=qcat&a=edit&t=<?php echo $mid?>&s=<?php echo $select;?>&id=<?php echo $v['CAT_ID']?>&p=<?php echo $page;?>" onclick="T.setCookie('goback_qcat','<?php echo $_SERVER['REQUEST_URI']?>')">修改</a>
		<a href="/index.php?c=qcat&a=del&id=<?php echo $v['CAT_ID']?>" onclick="return delmod();">删除</a></td>
	</tr>
	<?php }}else{?>
              <tr><td style="text-align:center;height: 50px;color:green;font-size:16px;" colspan='4'>没有您要搜索的结果</td></tr>
              <?php }?>
              <tr><td colspan='10'>
					<?php 
						$url = '/index.php?c=qcat&a=index&t='.$mid.'&s='.urlencode($select).'&p=_num_';
						echo JYTools::pager($url,$totalNum,$page,$pagesize);
					?>
			  </td></tr>
            </table>
        </div>
    </div>
<script>
function goPage(){
	var url = '/index.php?c=qcat&a=index&t=<?php echo $mid?>&s=<?php echo $select;?>&p='
	var go = document.getElementById('page')
	if(go.value!='' && go.value == parseInt(go.value)){
		url += go.value;
		document.location.href = url;
	}
}
$('.btn_search').click(function (){select();})
function select(){
	if($('#cateName').val()){
		document.location.href='/index.php?c=qcat&a=index&t=<?php echo $mid;?>&p=<?php echo $page;?>&s='+$('#cateName').val()
	}else{
		document.location.href='/index.php?c=qcat&a=index&t=<?php echo $mid;?>&p=<?php echo $page;?>&s='+$('#cateName').val()
	}
}
function delmod(){
	if(confirm('确定要删除该分类吗？')){
		return true;
	}else{
		return false;
	}
}
</script>
</script>
</body>
</html>
<script src="/js/boot.js"></script>
<script src="/js/tip.js"></script>
<script src="/js/add_public_head.js" type="text/javascript"></script>